<?php
/**
 * NOTICE OF LICENSE
 *
 * THIS SOURCE FILE IS PART OF EVEBIT'S PRIVATE PROJECT.
 * 
 * DO NOT USE THIS FILE IN OTHER PLACE.
 *
 * @category  China Wanderer
 * @package   Default
 * @author    Chen Qiao <chen.qiao@evebit.com>
 * @version   $$Id: index.phtml 1372 2011-06-20 09:24:33Z chen.qiao $$
 * @copyright Copyright (c) 2011 Evebit Inc. China (http://www.evebit.com)
 */
?>

<!-- begin edit-->
<script type="text/javascript">
	$(document).ready(function(){
		$("#form1").validationEngine();
	})
</script>
<div class="user_edit_wrapper">
  <form id="form1" name="form1" method="post" action="<?php echo $this->baseUrl('/user/index/edit') ?>">
    <div class="user_edit">
      <div class="user_edit_block">
        <div class="user_edit_block_lable">&nbsp;</div>
        <div class="user_edit_block_input" id="user_edit_title">Edit Account</div>
      </div>
      <div class="user_edit_block">
        <div class="user_edit_block_lable">Username:</div>
        <div class="user_edit_block_input">
          <input type="text" name="data[username]" id="data_username" value="<?php echo $this->user->username; ?>" class="validate[brequired,slength[6]]"/>
        </div>
      </div>
      <div class="user_edit_block" id="user_edit_block_password">
        <div class="user_edit_block_lable">Password:</div>
        <div class="user_edit_block_input" id="user_edit_block_input_password"><a href="##">Change Password?</a> </div>
      </div>
      <div class="user_edit_block">
        <div class="user_edit_block_lable">Email:</div>
        <div class="user_edit_block_input">
          <input type="text" name="data[email]" id="data_email" class="validate[required,custom[email]]" value="<?php echo $this->user->email ?>" />
        </div>
      </div>
      <div class="user_edit_block">
        <div class="user_edit_block_lable">&nbsp;</div>
        <div class="user_edit_block_input">
          <input type="submit" name="submit" id="submit2" value="Save" />
        </div>
      </div>
    </div>
    <input name="data[id]" type="hidden" value="<?php echo $this->user->id ?>" />
  </form>
</div>
<div class="clear_fix"></div>
<!-- End edit-->

<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
	$('#user_edit_block_input_password').click(function(){
		var content = '<div class="user_edit_block_lable">Password:</div>'
					 +'<div class="user_edit_block_input"><input name="data[password]" id="edit_user_password" class="validate[required,slength[6]" type="password" />'
					 +'</div>'
					 +'</div><div class="user_edit_block" id="user_edit_block_password">'
					 +'<div class="user_edit_block_lable">Confirm Password:</div>'
					 +'<div class="user_edit_block_input"><input name="data[confirm_password]" id="comfire_password" class="validate[required,confirm[edit_user_password]" type="password" />'
					 +'</div>';
		$('#user_edit_block_password').html(content); 
	});
});
</script>